<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of SubjectUrlService
 *
 * @author Administrator
 */
class SubjectUrlService {

    /**
     * 读取未取得Subject Content 内容的Url
     * @return type 
     */
    function findNoneLoadUrl() {
        $where['load_over'] = array('eq', 0);

        return D('subject_url')->where($where)->order('id asc')->find();
    }

    /**
     * 读取未取得Subject Content 内容的Url 集合
     * @return type 
     */
    function listNoneLoadUrl($limit) {
        $where['load_over'] = array('eq', 0);

        return D('subject_url')->where($where)->order('id asc')->limit($limit)->select();
    }
/**
     * 读取未取得Subject Content 内容的Url 集合
     * @return type 
     */
    function listNoneLoadUrlAll() {
        $where['load_over'] = array('eq', 0);

        return D('subject_url')->where($where)->order('id asc')->select();
    }

    function update($su) {
        return D('subject_url')->save($su);
    }

    function insertAll($suList) {
        D('subject_url')->addAll($suList);
    }

    function findSubjectUrlBySIdAndUrl($sId, $url) {
        $where['subject_id'] = array('eq', $sId);
        $where['url'] = array('eq', $url);


        return D('subject_url')->where($where)->find();
    }

}

?>
